//
//  inputViewController.m
//  11-23date
//
//  Created by mac on 15-11-23.
//  Copyright (c) 2015年 ztt. All rights reserved.
//

#import "inputViewController.h"

@interface inputViewController ()<UITextFieldDelegate>
{
    UITextField * tf;
    NSIndexPath * curindeexpath;
}
@end

@implementation inputViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    tf = [[UITextField alloc] initWithFrame:CGRectMake(10, 15, self.view.frame.size.width-30, 44 - 20)];
    tf.text = self.tel;
    tf.clearButtonMode = UITextFieldViewModeAlways;
    tf.delegate = self;
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"aaaa"];
    //self.navigationItem.rightBarButtonItem = self.editButtonItem;
    
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    [self.delegate inputFinished:textField.text];
    return YES;
}

- (void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    [tf becomeFirstResponder];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    //UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"aaaa"];
    [cell addSubview:tf];
    return cell;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
